package com.garry.user.controller;

import com.garry.user.entity.User;
import com.garry.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by GarryGe on 2016/11/29.
 */
@Controller
@RequestMapping(value = "/test")
public class UserController {

    @Autowired
    private IUserService userService;

    @RequestMapping(value = "/t",method = RequestMethod.GET)
    public String insert(Model model){
        User user=new User();
        user.setUsername("123");
        userService.save(user);
        model.addAttribute("test","123");
        return "index";
    }
}
